//
//  UIButton+Extension.swift
//  MyNews
//
//  Created by DF-Mac on 16/12/5.
//  Copyright © 2016年 DF-Mac. All rights reserved.
//

//let btn = UIButton()
//btn.setTitle("brn", for: .normal)
//btn.setTitleColor(UIColor.green, for: .normal)
//btn.sizeToFit()
//
//btn.center=view.center
//
//view.addSubview(btn)
//
//btn.addTarget(self, action: #selector(caculate), for: .touchUpInside)

import UIKit

extension UIButton {
    
    convenience init(title:String,titleColor:UIColor = UIColor.darkGray){
        self.init()
        
        self.setTitle(title, for: .normal)
        self.setTitleColor(titleColor, for: .normal)
        self.sizeToFit()
    }
}
